﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace Traceability.App
{
    public class MyExceptionFilter : IExceptionFilter
    {
        private readonly ILogger<MyExceptionFilter> logger;

        public MyExceptionFilter(ILogger<MyExceptionFilter> logger)
        {
            this.logger = logger;
        }

        public void OnException(ExceptionContext context)
        {
            logger.LogInformation($"【全局异常处理】：{context.Exception.Message}");
        }
    }
}
